<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--jstl을 쓰기 위해 사용 --%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><%--숫자 포맷을 사용하기 위해 사용 --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%><%--함수들을 이용하기 위해 사용 --%>
<%@ taglib prefix="c-rt" uri="http://java.sun.com/jstl/core_rt" %>  <%-- ie버전 확인에 쓰기 위해 씀 --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<!--<script type="text/javascript" src="script/sms_riskI_script.js"></script>-->
</head>
<body>
<div class="box">
      		<h4 class="white">
      			<span class="align-left">
				<!-- 구분에 따른 명칭 변경 -->      		
				<c:choose>
					<c:when test="${requestScope.v_gubun == 1}">
					자산공통 취약성 평가
					</c:when>
					<c:when test="${requestScope.v_gubun == 2}">
					개별 위험 취약성 평가
					</c:when>
				</c:choose>
				</span>
				
				<span class="align-left red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      			전체평가를 마치신 후 마감을 하시기 바랍니다.
      			</span>
				
				<span class="align-left">
      				<a onclick="openMagam(3)" class="button3"><span>마감</span></a>
      			</span>
				
				<span class="align-right">마감상태(취약성평가) :
		      		<c:choose>
		      			<c:when test="${sessionScope.magamSession[3].state =='Y'}">
		      				 마감
		      			</c:when>
		      			<c:otherwise>
		      				 착수
		      			</c:otherwise>
		      		</c:choose>
	      		</span>
      		</h4>




<c:choose>
	<c:when test="${requestScope.v_gubun==1 || requestScope.v_gubun==2}">

        <div class="box-container1">     		
        	<table class="table-long" style="table-layout: auto">
      			<tfoot>
      				<tr>
      					<td><div class="align-left" id="tsNmDiv1" style="display: none"><a href="#" class="button1" style="margin:0px;"><span id="tsNm1"></span></a></div></td>
      					<td><div class="align-left" id="tsNmDiv2" style="display: none"><a href="#" class="button1" style="margin:0px;"><span id="tsNm2"></span></a></div></td>
      					<td><div class="align-left" id="tsNmDiv3" style="display: none"><a href="#" class="button1" style="margin:0px;"><span id="tsNm3"></span></a></div></td>
      					<td><div class="align-left" id="tsNmDiv4" style="display: none"><a href="#" class="button1" style="margin:0px;"><span id="tsNm4"></span></a></div></td>
      				</tr>
      				<tr>
      					<td colspan="4">
      						 <div class="align-left">      					
	      						<a href="#" class="button1"><span style="font-size: small;">평가 완료 / 전체 : ${requestScope.pyungCount } / ${fn:length(list)}</span></a>
	      					</div>
      						
	      					<div class="align-right"><!--select class="form-select"><option value="option1">Bulk Options</option>
	      					<option value="option2">Delete All</option></select>
	      					<a href="#" class="button" onclick="javascript: riskIWritePage('mvlist_insertPage')"><span>작성</span></a>
	      					<a href="#" class="button" onclick="javascript: mavlistp_insertPage()"><span>취약성평가대상 생성</span></a>
	      					-->
	      					<a href="riskIAction.do?mode=exmavlistp&v_gubun=${requestScope.v_gubun }&searchText=${param.searchText }" class="button"><span>엑셀</span></a>
	                        <c:choose>
	                       		<c:when test="${sessionScope.magamSession[3].state !='Y'}">
	                       		<!-- 마감 현황이 유무 판별(Y 시 입력 불가) -->
	                        		<a href="#" class="button" onclick="javascript: riskIDelete()"><span>삭제</span></a>
	                       		</c:when>
	                       		<c:otherwise>
	      							<a href="#" class="button1 addMargin" onclick="return false;"><span>삭제</span></a>
	                       		</c:otherwise>
	                       	</c:choose>
	                        </div>
	                        
	      					<!-- 검색 -->
	                        <div class="align-right" style="margin-right: 80px">
	      						<span style="width: 22px; height: 22px; background: url('img/icon-view-info.gif') no-repeat scroll right center transparent;  overflow: hidden;display:inline-block;"></span>
	      						<span style="vertical-align: top"><input name="searchText" type="text" id="searchText" style="width:140px;" value="${param.searchText }" /></span>
	      						<span><a href="#" class="button rightNoMargin verticTop" onclick="searchText2('mavlistp','${requestScope.v_gubun }')"><span>조회</span></a></span>
      						</div>
                        </td>
      				</tr>
      				<tr><td class="spaceLine" colspan="4"></td></tr>
      			</tfoot>
      		</table>
      		<form name="riskIDelForm" action="riskIAction.do" method="post">
        	<input type="hidden" name="mode" value="mavlistp_delete"></input>
        	<input type="hidden" name="pro_id" id="pro_id" value="${sessionScope.lastProId }"></input>
        	<input type="hidden" name="v_gubun" id="v_gubun" value="${requestScope.v_gubun }"></input>
      		<table class="table-long">
      			<colgroup>
				<%-- ie67인지 아닌지 판단 (위=ie)(아래는 그외)--%> 
					<c-rt:choose>
						<c-rt:when test="${isMSIE67}">
							<col width="40px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="40px"/>
							<col width="55px"/>
							<col width="30px"/>
							<col width="30px"/>
							<col width=""/>
							<col width="15px"/>
						</c-rt:when>
						<c-rt:otherwise>
							<col width="40px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="75px"/>
							<col width="75px"/>
							<col width="60px"/>
							<col width="75px"/>
							<col width="40px"/>
							<col width="70px"/>
							<col width="30px"/>
							<col width="30px"/>
							<col width=""/>
							<col width="15px"/>
						</c-rt:otherwise>
					</c-rt:choose>
				</colgroup>	
      			<thead>
      				<tr>
      					<td class="col-chk" rowspan="2"><input type='checkbox' name='checkAll' onclick="javascript: selectAll()" class="chkCursor"></input></td>
      					<td class="col-rowspanMid" rowspan="2">보안<br/>통제영역</td>
      					<td class="col-rowspanMid" rowspan="2">보안<br/>통제항목</td>
      					<td class="col-rowspanMid" rowspan="2">보안통제<br/>세부항목</td>
      					<td class="col-rowspanMid" rowspan="2">취약성<br/>평가항목</td>
      					<td class="col-rowspanMid" rowspan="2">취약<br/>성명</td>
      					<td class="col-rowspanMid" rowspan="2">연관<br/>자산</td>
      					<td class="col-rowspanMid" rowspan="2">모범<br/>관행</td>
      					<td class="col-rowspanMid" rowspan="2">항목<br/>중요도</td>
      					<td class="col-rowspanMid" rowspan="2">취약점<br/>상세</td>
      					<td colspan="2" class="lowPadding1 ">&nbsp;
      					항목평가
      					</td>
      					<td class="col-rowspanMid" rowspan="2">취약성<br/>점수</td>
      					<td class="col-rowspanMid" rowspan="2"></td>
      				</tr>
      				<tr>
      					<td class="lowPadding2 col-rowspanMid">등급</td>
      					<td class="lowPadding2 col-rowspanMid">평점</td>
      				</tr>
      			</thead>
      		</table>
      		<div class="scrollDIV" style="height: 470px">
      		<table class="table-long">
      			<colgroup>
				<%-- ie67인지 아닌지 판단 (위=ie)(아래는 그외)--%> 
					<c-rt:choose>
						<c-rt:when test="${isMSIE67}">
							<col width="40px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="40px"/>
							<col width="55px"/>
							<col width="30px"/>
							<col width="30px"/>
							<col width=""/>
							<col width="15px"/>
						</c-rt:when>
						<c-rt:otherwise>
							<col width="40px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="60px"/>
							<col width="75px"/>
							<col width="75px"/>
							<col width="60px"/>
							<col width="75px"/>
							<col width="40px"/>
							<col width="70px"/>
							<col width="30px"/>
							<col width="30px"/>
							<col width=""/>
							<col width="15px"/>
						</c-rt:otherwise>
					</c-rt:choose>
				</colgroup>
      			<tbody>
      				<c:choose>
                    	<c:when test="${fn:length(list)!= 0}">
                       	<c:forEach var="list" items="${requestScope.list}" varStatus="status">
	                    			<%--
	                    			<tr onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');" class="odd">
	                    			 --%>
                   			  <%--<tr <c:if test="${status.index%2==0 }">class="odd"</c:if> onclick="allTsNm('${list.v_id }')" onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');"> --%>
                   			  <tr <c:if test="${status.index%2==0 }">class="odd"</c:if>  onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');"> 
                    			<td class="col-chk"><input type="checkbox" name="check" id="check${status.index+1 }"  class="chkCursor" value='${list.v_id}'></input></td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;"><a href="riskIAction.do?mode=mavlistp_updatePage&v_id=${list.v_id }&v_gubun=${list.v_gubun }" class="nor ellipsis" title='${list.ts_nm2}'><c:forTokens var="token" items="${list.ts_nm2}" delims="(" begin="1">(${token}</c:forTokens></a></div>
                    			</td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;"><a href="riskIAction.do?mode=mavlistp_updatePage&v_id=${list.v_id }&v_gubun=${list.v_gubun }" class="nor ellipsis" title='${list.ts_nm3 }'><c:forTokens var="token" items="${list.ts_nm3}" delims="(" begin="1">(${token}</c:forTokens></a></div>
                    			</td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;"><a href="riskIAction.do?mode=mavlistp_updatePage&v_id=${list.v_id }&v_gubun=${list.v_gubun }" class="nor ellipsis" title='${list.ts_nm4 }'><c:forTokens var="token" items="${list.ts_nm4}" delims="(" begin="1">(${token}</c:forTokens></a></div>
                    			</td>
                    			<td>
                    				<div class="ellipsis" style="width:100%;" title="${list.vp_item }">${list.vp_item }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis" style="width:100%;" title="${list.v_nm }">${list.v_nm }</div>
                    			</td>
                    			<td>
                    				<c:choose>
	                    				<c:when test="${list.raitem_cnt==0 }">
	                    					<a class="button1" style="margin: 0"><span>${list.raitem_cnt }</span></a>
	                    				</c:when>
	                    				<c:otherwise>
	                    					<a href="#" class="button" style="margin: 0" onclick="openMappingMavlistp('${list.v_id }','${list.ts_cd1 }','${list.ts_cd2 }','${list.ts_cd3 }')"><span>${list.raitem_cnt }</span></a>
	                    				</c:otherwise>
                    				</c:choose>
                    			</td>
                    			<td>
                    				<div class="ellipsis" style="width:100%;" title="${list.good_model }">${list.good_model }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis" style="width:100%;" title="<fmt:formatNumber value="${list.v_status }" pattern="0"/>">&nbsp;&nbsp;&nbsp;&nbsp;<fmt:formatNumber value="${list.v_status }" pattern="0"/></div>
                    			</td>
                    			<td>
                    				<div class="ellipsis" style="width:100%;" title="${list.v_detail }">${list.v_detail }</div>
                    			</td>
                    			<td>
                    				<c:if test="${list.vp_kind!=null }">
                    					<div title="${list.vp_kind }">&nbsp;&nbsp;${list.vp_kind }</div>
                    				</c:if>
                    			</td>
                    			<td>
                    				<c:if test="${list.vp_kind!=null }">
                    					<div title="${list.vp_score }"><fmt:formatNumber value="${list.vp_score }" minFractionDigits="1"/></div>
                    				</c:if>
                    			</td>
                    			<td>
                    				<c:if test="${list.vp_kind!=null }">
                    					<div title="${list.vp_total }"><fmt:formatNumber value="${list.vp_total }" minFractionDigits="1"/></div>
                    				</c:if>
                    			</td>
	   					 	<td></td>
                    		</tr>
                    	</c:forEach>
                    	</c:when>
                    	<c:otherwise>
                    		<tr class="odd">
								<td colspan="14" class="noDataTD">-데이터가 없습니다-</td>
							</tr>
                    	</c:otherwise>
                    	</c:choose>
      			</tbody>
      		</table>  	
      		</div>
      		</form>
      	</div><!-- end of div.box-container1 -->
      	
	</c:when>
	<c:otherwise>
		<script type="text/javascript">
		alert("잘못 접속하셨습니다");
		location.href="smsAction.do?mode=mainPage";
		</script>
	</c:otherwise>
</c:choose>
      	</div> <!-- end of div.box -->
      	
</body>
</html>